<?php

namespace Library;

class View {

	private $_view = null;
	
	public function __construct() {
	}
	
	public function view() {
		ob_start();
		require 'View/' . $this->getView() . '.html';
		return ob_get_clean();
	}
	
	public function setView( $view ) {
		$this->_view = $view;
		return $this;
	}
	
	public function getView() {
		if( $this->_view === null ) {
			$this->_view = strtr( get_class( $this ), '\\', '/' );
		}
		return $this->_view;
	}
}
